﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DesignPatterns.Proxy
{
    public partial class FrmProxy : FrmBase
    {
        private Proxy daili;

        public FrmProxy()
        {
            InitializeComponent();

            var jiaojiao = new SchoolGirl("李娇娇");
            daili = new Proxy(jiaojiao);

            btnGiveFlowers.Click += BtnGiveFlowers_Click;
            btnGiveDolls.Click += BtnGiveDolls_Click;
            btnGiveChocolate.Click += BtnGiveChocolate_Click;
        }

        private void BtnGiveChocolate_Click(object sender, EventArgs e)
        {
            labResult.Text = daili.GiveChocolate();
        }

        private void BtnGiveDolls_Click(object sender, EventArgs e)
        {
            labResult.Text = daili.GiveDolls();
        }

        private void BtnGiveFlowers_Click(object sender, EventArgs e)
        {
            labResult.Text = daili.GiveFlowers();
        }
    }
}
